package cn.gson.crm.control.allot;

import java.util.List;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.gson.crm.control.base.BaseServlet;
import cn.gson.crm.model.dao.AllotDao;
import cn.gson.crm.model.dao.CooperationDao;
import cn.gson.crm.model.dao.StaffPoDao;
import cn.gson.crm.model.po.AllotPo;
import cn.gson.crm.model.po.CooperationPo;
import cn.gson.crm.model.po.StaffPo;
@WebServlet("/allot/student")
public class AllotStudentSetvlet extends BaseServlet{
	private AllotDao allotDao = new AllotDao();
	private StaffPoDao staffPoDao = new StaffPoDao();
	private CooperationDao cooperationDao = new CooperationDao();
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Override
	protected void get(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String staffId = request.getParameter("staffid");
		StaffPo staffPo = staffPoDao.getStaffPo(staffId);
		List<AllotPo> allotList = allotDao.getAllotList(staffId);
		List<CooperationPo> cooperationList = cooperationDao.getCooperationList(staffId);
		request.setAttribute("staffPo", staffPo);
		request.setAttribute("allotList", allotList);
		request.setAttribute("cooperationList", cooperationList);
		forward("allot/allot_student.jsp");
	}
}
